<template>

    <div class="second_block" v-if="visible" :style="endPageHeight">
      <div style="text-align: center;">
        <img src="/static/logo.png" style="width: 80px;height: 75px">
      </div>
      <el-divider></el-divider>
      <br>
      <div :style="scriptHeight">{{script_1}}</div>

    </div>
</template>

<script>
export default {
  name: "end-page",
  props: {
    // 弹窗是否打开
    visible: Boolean,
    data: Object,
  },
  data() {
    return {
      // 表单数据
      form: Object.assign({}, this.data),
      // 表单验证规则
      rules: {
      },
      // 提交状态
      loading: false,
      // 是否是修改
      isUpdate: false,
      contact_email:'',
      process_end_page_script_operate:'',
      endPageHeight:'',
      scriptHeight:'',
    };
  },
  mounted () {
    // 根据不同路由跳转不同页面
    if (this._isMobile()) {
      this.endPageHeight = 'width: calc(100vw - 100px)';
      this.scriptHeight = 'font-size: 17px;text-align: center;font-weight: bold;color: #000000;line-height: 30px';
    } else {
      this.endPageHeight = 'width: calc(100vw - 1230px)';
      this.scriptHeight = 'font-size: 17px;text-align: center;font-weight: bold;color: #000000;line-height: 30px';
    }
  },
  methods : {
    // 判断是否是手机端，如果是，返回true
    _isMobile () {
      let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
      return flag
    },
    setData(info)
    {
      this.script_1 = info.operate_list.process_end_page_script_operate.script_1;
    },
    setBuyerConfig(data){
      this.contact_email = data.contact_email;
      this.script_1 = data.gift_end_page_script.script_1;
    },

  }
}
</script>

<style scoped>

</style>
